package board.dao;

import java.sql.SQLException;
import java.util.List;

import board.model.BoardFiles;
import board.model.BoardVo;

import com.util.SqlMapLocator;

public class FileDAO {
	private static FileDAO singleton;
	private FileDAO(){
	}
	public static FileDAO getInstance(){
		if(singleton == null)
			singleton = new FileDAO();
		return singleton;
	}
	
	public List<BoardFiles> list(Object obj) throws SQLException{
		List<BoardFiles> list = (List<BoardFiles>)SqlMapLocator.getMapper().queryForList("FileList",obj);
		return list;
	}
	public void insert(Object obj) throws SQLException{
		SqlMapLocator.getMapper().insert("FileInsert", (BoardFiles)obj );
	}
	public void update(Object obj) throws SQLException{
		SqlMapLocator.getMapper().update("FileUpdate",obj);
	}
	public void delete(Object obj) throws SQLException{
		SqlMapLocator.getMapper().update("FileDelete",obj);
	}
}
